package action.chap8;

/**
 * @program: study-java8
 * @description:
 * @author: Sun Feng
 * @create: 2020-06-02 11:27
 **/
public class Test {
    public static void main(String[] args) {
        Validator numericValidator = new Validator(new IsNumeric());
        System.out.println(numericValidator.validate("aaaa"));
        Validator lowerCaseValidator = new Validator(new IsAllLowerCase ());
        System.out.println(lowerCaseValidator.validate("bbbb"));

        Validator numericValidator2 =
                new Validator((String s) -> s.matches("[a-z]+"));
        System.out.println(numericValidator2.validate("aaaa"));
        Validator lowerCaseValidator2 =
                new Validator((String s) -> s.matches("\\d+"));
        System.out.println(lowerCaseValidator2.validate("bbbb"));

    }
}
